home *** CD-ROM | disk | FTP | other *** search
-
- -- Collection class
-
- indexing
-
- names: collection, container, data_structures;
- contents: generic;
-
- author: "Guichard Damien";
- created: 9,November,1995;
- modified: 9,November,1995
-
- deferred class COLLECTION
- feature
- add (element:COLLECTION) is
- -- Add an element to the collection.
- require -- element /= Void
- deferred
- end -- add
- find (key:ANY):like Current is
- -- Find first occurrence in the collection matching 'key'.
- deferred
- end -- find
- count:INTEGER is
- -- Available elements.
- deferred
- end -- count
- empty:BOOLEAN is
- -- Is collection empty?
- do
- Result := count = 0
- ensure
- -- Result = (count = 0)
- end -- empty
- invariant
- -- count >= 0
- end -- class 'COLLECTION'
-
-